import java.util.AbstractSet;
import java.util.Scanner;

public class Demo1 {
        public static boolean func(int n) {

            for(int i = 2; i < n;i++) {
                if(n%i == 0) {
                    return false;
                }
            }

            return true;
        }

        public static void main(String[] args) {
            
            Scanner scan = new Scanner(System.in);
            int n = scan.nextInt();
            int sum= 0;
            int result = n;
            int a = 0;
            int b = 0;

            for(int i= 1; i < n;i++) {
                for(int j = 1; j < n;j++) {
                    if( i + j == n && func(i) && func(j)) {
                        sum = Math.abs(i - j);
                        if(sum < result) {
                            result = sum;
                            a = i;
                            b = j;
                        }
                    }
                }
            }

            System.out.println(a);
            System.out.println(b);
        }
}
